package cn.hy.async;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

@Component
public class LineRunner implements CommandLineRunner {
    @Autowired
    private AsyncComponent asyncComponent;

    @Override
    public void run(String... args) throws Exception {
        // System.out.println("主线程开始");
        asyncComponent.async("今天不上班，好耶");
        asyncComponent.selfAsync();
        asyncComponent.sync("同步方法 ... ");
        // System.out.println("主线程结束");
    }
}
